package com.czxy;

import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import java.io.IOException;


@Component
public class Receiver2 {
    @Bean
    public Queue createQueue(){
        return new Queue("q1");
    }

    @RabbitListener(queues = "q1")
    public void process(String msg) throws IOException {
//        channel.basicQos(1);
        System.out.println("receiver2: "+msg);
//        channel.basicAck(message.getMessageProperties().getDeliveryTag(),false);
    }
}